from wtforms import StringField, IntegerField
from wtforms.validators import DataRequired, Length

from .base import BaseFrom


class SpaceForm(BaseFrom):
    name = StringField(validators=[DataRequired(message="name不允许为空"), Length(min=1, max=18)])


class DeleteSpaceForm(BaseFrom):
    id = IntegerField(validators=[DataRequired(message="id不允许为空")])


class SearchSpaceForm(BaseFrom):
    keyword = StringField(validators=[DataRequired(message="关键字不允许为空"), Length(min=1, max=18)])
